home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
vbback
/
vbback.frm
< prev
next >
Wrap
Text File
|
1997-01-11
|
4KB
|
121 lines
VERSION 2.00
Begin Form vbback
BackColor = &H0000DEAD&
Caption = "VB Background Chooser"
ClientHeight = 5820
ClientLeft = 1095
ClientTop = 1485
ClientWidth = 7365
Height = 6225
Left = 1035
LinkTopic = "Form1"
ScaleHeight = 5820
ScaleWidth = 7365
Top = 1140
Width = 7485
WindowState = 2 'Maximized
Begin CommandButton Command1
Caption = "save colors"
Height = 375
Left = 1320
TabIndex = 3
Top = 600
Width = 1695
End
Begin TextBox Text1
Height = 615
Left = 4080
TabIndex = 2
Top = 1560
Width = 1815
End
Begin ComboBox cmbBacks
Height = 1575
Left = 1080
Style = 1 'Simple Combo
TabIndex = 0
Text = "&H0000DEAD&"
Top = 1320
Width = 2535
End
Begin Label Label1
BackStyle = 0 'Transparent
Caption = "add color to list:"
Height = 375
Left = 4080
TabIndex = 1
Top = 1200
Width = 2175
End
End
Sub cmbBacks_KeyPress (KeyAscii As Integer)
If KeyAscii <> 13 Then Exit Sub
On Error GoTo CntSet
BackColor = Val(cmbBacks.Text)
On Error GoTo 0
Exit Sub
CntSet:
MsgBox "could not set background"
Exit Sub
End Sub
Sub Command1_Click ()
Dim fname, I
fname = InputBox("Enter filename to save as:")
On Error GoTo CS
Open fname For Output As #1
For I = 0 To cmbBacks.ListCount - 1
Print #1, cmbBacks.List(I)
Next I
Close #1
On Error GoTo 0
Exit Sub
CS:
MsgBox "couldn't save colors"
Exit Sub
End Sub
Sub Form_Load ()
Show
Me.cmbBacks.AddItem "&H0000DEAD&"
Me.cmbBacks.AddItem "&H0011DEAD&"
Me.cmbBacks.AddItem "&H0022DEAD&"
Me.cmbBacks.AddItem "&H0033DEAD&"
Me.cmbBacks.AddItem "&H0044DEAD&"
Me.cmbBacks.AddItem "&H0055DEAD&"
Me.cmbBacks.AddItem "&H0066DEAD&"
Me.cmbBacks.AddItem "&H0077DEAD&"
Me.cmbBacks.AddItem "&H0088DEAD&"
Me.cmbBacks.AddItem "&H0099DEAD&"
Me.cmbBacks.AddItem "&H00AADEAD&"
Me.cmbBacks.AddItem "&H00BBDEAD&"
Me.cmbBacks.AddItem "&H00CCDEAD&"
Me.cmbBacks.AddItem "&H00DDDEAD&"
Me.cmbBacks.AddItem "&H00EEDEAD&"
Me.cmbBacks.AddItem "&H00FFDEAD&"
Me.cmbBacks.AddItem "&H00DAD000&"
Me.cmbBacks.AddItem "&H00DAD111&"
Me.cmbBacks.AddItem "&H00DAD222&"
Me.cmbBacks.AddItem "&H00DAD333&"
Me.cmbBacks.AddItem "&H00DAD444&"
Me.cmbBacks.AddItem "&H00DAD555&"
Me.cmbBacks.AddItem "&H00DAD666&"
Me.cmbBacks.AddItem "&H00DAD777&"
Me.cmbBacks.AddItem "&H00DAD888&"
Me.cmbBacks.AddItem "&H00DAD999&"
Me.cmbBacks.AddItem "&H00DADAAA&"
Me.cmbBacks.AddItem "&H00DADBBB&"
Me.cmbBacks.AddItem "&H00DADCCC&"
Me.cmbBacks.AddItem "&H00DADDDD&"
Me.cmbBacks.AddItem "&H00DADEEE&"
Me.cmbBacks.AddItem "&H00DADFFF&"
Me.cmbBacks.AddItem "&H00DADDAD&"
End Sub
Sub Text1_KeyPress (KeyAscii As Integer)
If KeyAscii <> 13 Then Exit Sub
KeyAscii = 0 'Cancel keystroke
cmbBacks.AddItem Text1.Text
End Sub